import { request } from '@@/exports';
import { ResultList } from '@/types/common/request';
import { MENU_CODES, METHOD_TYPE, MODULES } from '@/options';

const ApiUrl = `/${MODULES.MICRO}/${MENU_CODES.DISTRICT}`;

export const getDistrict = (params?: District_TYPE.Params, options?: { [key: string]: any }) => {
  return request<ResultList<District_TYPE.Info>>(ApiUrl + '/list', {
    method: METHOD_TYPE.GET,
    params,
    ...(options || {}),
  });
};

export const getDistrictById = (id: string, options?: { [key: string]: any }) => {
  return request<ResultList<District_TYPE.Info>>(ApiUrl, {
    method: METHOD_TYPE.GET,
    params: { id },
    ...(options || {}),
  });
};
